import React, { PureComponent } from 'react'

class App extends PureComponent {
  render() {
    return (
      <div>
        App: {this.props.name}
      </div>
    )
  }
}

function enhanceComponent(WrapperComponent) {
  class NewComponent extends PureComponent {
    render() {
      return <WrapperComponent {...this.props}/>
    }
 }

 NewComponent.displayName = 'L'

 return NewComponent
}

function enhanceComponent2(WrapperComponent) {
  function NewComponent(props) {
    return <WrapperComponent {...props}/>
  }

  NewComponent.displayName = 'X'

  return NewComponent
 }

const EnhanceComponent = enhanceComponent2(App)

export default EnhanceComponent